package cn.com.nes.site.entity.em;

import cn.hutool.core.util.ObjectUtil;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * 工单拒单类型枚举
 *
 * @Author: ShenWei
 * @Date: 2024/09/04/10:05
 */
@Getter
public enum WorkOrderRejectionTypeEnum {

    TEAM_MEMBER(0, "施工队员拒单"),
    CAPTAIN(1, "施工队长/无团队师傅拒单"),
    ;

    private Integer key;
    private String value;

    WorkOrderRejectionTypeEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public static String getVal(Integer key) {
        Map<Integer, String> map = new HashMap<>();
        for (WorkOrderRejectionTypeEnum item : values()) {
            map.put(item.getKey(), item.getValue());
        }
        return ObjectUtil.isNull(key) ? "" : map.get(key);
    }
}
